package com.potato.model1.api;

import com.potato.base.BaseApp;
import com.potato.model1.bean.CategoryResult;
import com.potato.network.bean.BaseEntity;
import com.potato.network.bean.BaseListEntity;

import java.util.HashMap;
import java.util.List;

import io.reactivex.Observable;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

public interface Api {

     static RequestBody getRequestBody(HashMap<String, Object> params) {
        return RequestBody.create(MediaType.parse("application/json; charset=utf-8"),
                BaseApp.mGson.toJson(params));
    }

    @POST("advisory/getHealthPage")
    Observable<BaseListEntity<String> > getHealthNews(@Body RequestBody requestBody);


    @GET("data/{category}/{pageSize}/{page}")
    Observable<BaseEntity<List<CategoryResult>>> getGankData(@Path("category") String category,
                                                             @Path("pageSize") String pageSize,
                                                             @Path("page") String page);
}
